<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePrizesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity_prizes', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('activity_id');
            $table->string('prize_type');       // 奖品类型，优惠卷还是未中奖
            $table->unsignedInteger('coupon_id');
            $table->decimal('probability', 5, 2); // 中奖概率（百分比）
            $table->integer('order')->default(0)->comment('排序');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activity_prizes');
    }
}
